<template>
	<view>
		<view class="header status_bar" :class="scrrol == true ? 'scrrolHeader' : ''">
			<view class="back iconfont icon-xiangzuo1" @tap="backPage"></view>
			<view class="text" :class="scrrol == true ? 'scrrolHeader' : ''">客服</view>
		</view>
		<view class="clear_box"></view>

		<view class="kf_box">
			<image src="../../static/kef.png" mode="widthFix"></image>
		</view>
		<view class="ft_title">为您竭诚服务</view>
		<view class="ft_text">服务热线：{{phone}}</view>
		<view class="ft_text">客服微信：{{wechat}}</view>


		<button class="confirm02" @click="copyText()">复制微客服信号</button>




	</view>
</template>

<script>
	export default {
		data() {
			return {
				page: 1,
				scrrol: false,
				info: '',
				wechat:'',
				phone:'',
			}
		},
		onLoad() {
			let that = this;
			that.loadData();
		},
		methods: {
			loadData() {
			let that = this;
				that.Net._get('index/service', {}, res => {
					if (res.code == 200) {
						that.info = res.data;
						that.wechat = res.data.wechat;
						that.phone = res.data.phone;
					}
				});
			},
			copyText(){
				uni.setClipboardData({
				    data: this.wechat,
				    success: function () {
				        uni.showToast({
							title: '复制成功',
							icon: 'success',
				            duration: 2000
				        });
				    }
				});
			},
			backPage() {
				uni.navigateBack({});
			},
			gotopage(e) {
				let url = e.currentTarget.dataset.url;
				uni.navigateTo({
					url: url
				});
			},

		},
		onPageScroll: function(Object) {
			//console.log(Object.scrollTop); //实时获取到滚动的值
			if (Object.scrollTop > 28) {
				this.scrrol = true;
				/* #ifdef APP-PLUS */
				/* #endif */
			} else if (Object.scrollTop < 28) {
				this.scrrol = false;
				/* #ifdef APP-PLUS */
				/* #endif */
			}
		},
	}
</script>

<style>
	.header {
		background-color: transparent !important;
	}

	.header .back {
		color: #333 !important;
	}

	.header .text {
		background-color: transparent !important;
		color: #333 !important;
	}

	.scrrolHeader {
		background-color: #FF7701 !important;
	}

	.confirm02 {
		width: 60%;
	}

	.kf_box {
		width: 100%;
		text-align: center;
		margin-top: 6vw;
	}

	.kf_box image {
		width: 50%;
		margin: 0 auto;
	}

	.ft_title {
		width: 100%;
		font-size: 6vw;
		color: #666;
		text-align: center;
		font-weight: bold;
		margin-top: 18vw;
	}

	.ft_text {
		width: 100%;
		font-size: 3.5vw;
		color: #999;
		text-align: center;
		margin-top: 2vw;
	}
</style>